#import "../fragments/security_report_scans.fragment.graphql"
#import "~/vue_shared/security_reports/graphql/fragments/job_artifacts.fragment.graphql"

query pipelineSecuritySummary(
  $fullPath: ID!
  $pipelineIid: ID!
  $reportTypes: [SecurityReportTypeEnum!]
) {
  project(fullPath: $fullPath) {
    id
    pipeline(iid: $pipelineIid) {
      id
      # eslint-disable-next-line @graphql-eslint/require-id-when-available
      ...JobArtifacts
      securityReportSummary {
        dast {
          vulnerabilitiesCount
          scannedResourcesCsvPath
          ...SecurityReportSummaryScans
          # The following fields will be added in
          # https://gitlab.com/gitlab-org/gitlab/-/issues/321586
          # scannedResourcesCount
          # scannedResources {
          #   nodes {
          #     requestMethod
          #     url
          #   }
          # }
        }
        sast {
          vulnerabilitiesCount
          ...SecurityReportSummaryScans
        }
        containerScanning {
          vulnerabilitiesCount
          ...SecurityReportSummaryScans
        }
        dependencyScanning {
          vulnerabilitiesCount
          ...SecurityReportSummaryScans
        }
        apiFuzzing {
          vulnerabilitiesCount
          ...SecurityReportSummaryScans
        }
        coverageFuzzing {
          vulnerabilitiesCount
          ...SecurityReportSummaryScans
        }
        clusterImageScanning {
          vulnerabilitiesCount
          ...SecurityReportSummaryScans
        }
        secretDetection {
          vulnerabilitiesCount
          ...SecurityReportSummaryScans
        }
      }
    }
  }
}
